const express=require('express');
const shopdata=require('./datajson');
const app=express();
app.listen(8080);
app.use(express.static('./public'));
app.get('/list',(req,res)=>{
//console.log(req);
//res.send('hello');
//res.send({"huoia":"dsd","sd":19});
res.send(shopdata);
});
app.get('/query',(req,res)=>{
let obj=req.query
/*for(obj.id in shopdata){
    res.send(shopdata[obj.id]);
}*/

console.log(shopdata[obj.id-1]);
res.send(shopdata[obj.id-1]);
});
/*app.get('/search:id',(req,res)=>{
let obj=req.params;


});*/